/*
 * ============================================================================
 *                   GNU Lesser General Public License
 * ============================================================================
 *
 *
 *
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
 * 
 *
 *
 */
package rad.framework.jaxr;

import java.util.HashMap;
import java.util.Map;

/**
 * This is a simple implementation intended for use in unit testing. It uses a
 * map to store serviceName to address.
 * 
 * @author boudyacho
 * 
 */
public class SimpleDiscoveryService implements SimpleDiscoveryServiceMBean {

	private Map<String, String> addresses = new HashMap<String, String>();

	public void create() throws Exception {
	}

	public void start() throws Exception {
	}

	public void stop() {
	}

	public void destroy() {
	}

	public Map<String, String> getAddresses() {
		return addresses;
	}

	public void setAddresses(Map<String, String> addresses) {
		this.addresses = addresses;
	}

	public String discover(String service) {
		return addresses.get(service);
	}

	public void changeAddress(String service, String address) {
		addresses.put(service, address);
	}

	public void register(String serviceName, String serviceNS,
			String portTypeName, String portTypeNS, String bindingName,
			String bindingNS, String accessPoint) {
		addresses.put(serviceName, accessPoint);
	}

	public void register(String url) {
		throw new UnsupportedOperationException();
	}

	public String getAddressOverrideFileName() {
		return null;
	}

	public String getBusinessEntity() {
		return null;
	}

	public String getConnectionFactoryClass() {
		return null;
	}

	public String getPassword() {
		return null;
	}

	public String getPublishUrl() {
		return null;
	}

	public String getQueryUrl() {
		return null;
	}

	public String getTransportClass() {
		return null;
	}

	public String getUserId() {
		return null;
	}

	public void setAddressOverrideFileName(String name) {
		throw new UnsupportedOperationException();
	}

	public void setBusinessEntity(String name) {
		throw new UnsupportedOperationException();
	}

	public void setConnectionFactoryClass(String className) {
		throw new UnsupportedOperationException();
	}

	public void setPassword(String pPassword) {
		throw new UnsupportedOperationException();
	}

	public void setPublishUrl(String url) {
		throw new UnsupportedOperationException();
	}

	public void setQueryUrl(String url) {
		throw new UnsupportedOperationException();
	}

	public void setTransportClass(String className) {
		throw new UnsupportedOperationException();
	}

	public void setUserId(String id) {
		throw new UnsupportedOperationException();
	}
}
